<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册新成员</title>
    <style>
        body{
            background-image: url("images/绿色背景.jpg");
        }
    </style>
</head>
<body>
<div style="
margin-left:auto;
margin-right:auto;
max-width: 500px;
background: #F8F8F8;
padding: 30px 30px 20px 30px;
font: 12px Arial, Helvetica, sans-serif;
color: #666;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;">
<form  action="member/add" method="post" onsubmit="return validateForm()">
    <h2 style="color: #57AA2C">注册模块</h2>
    <hr><br>
    姓名：<input style="
display: block;
margin: 0px 0px 5px;" type="text" name="name" required="required"/>
    <br/>
    性别：<select name="sex">
      <option>男</option>
      <option>女</option>
      <option>Lesbian</option>
      <option>Gay</option>
      <option>Bisexual</option>
      <option>Transgender</option>
      <option>Queer</option>
      <option>InterSex</option>
      <option>Asexual</option>
      <option>Other</option>
    </select>
    <br/><br>
    联系方式：<input style="
display: block;
margin: 0px 0px 5px;" type="text" name="tel" required="required"/>
    <br/>
    密码：<input style="
display: block;
margin: 0px 0px 5px;" type="password" id="pw1" name="password" required="required"/>
    <br/>
    确认密码：<input style="
display: block;
margin: 0px 0px 5px;" type="password" id="pw2" required="required"/>
    <br/>
    <input type="hidden" name="teamid" placeholder="如尚未加入任何队伍请填: -1 " value="-1"/>
    <input style="
    background-color: #9DC45F;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-border-radius: 5px;
border: none;
padding: 10px 25px 10px 25px;
color: #FFF;
text-shadow: 1px 1px 1px #949494;" type="submit" value="注册"/>

</form>
    <br>
<a href="/index.html"><button>返回首页</button></a>
<script>
    function validateForm() {
        let pswd1 = document.getElementById("pw1").value;
        let pswd2 = document.getElementById("pw2").value;

        if(pswd1 !== "" || pswd2 !== "") {
            if(pswd1 !== pswd2) {
                alert("确认密码不一致！");
                return false;
            }
        }
        return true;
    }
</script>
</div>

</body>
</html>